

<div class="layui-card">
    <div class="layui-card-body">

        <div class="layui-card-table layui-tab">
            <div class="layui-tab-content">
                <form  class="layui-form layui-form-pane form-search" action="/pcs/order/chageporter" onsubmit="return false" method="get" autocomplete="off" data-table-id="OrderTable">>
                    <div class="layui-form-item layui-inline">
                        <label class="layui-form-label">姓名</label>
                        <div class="layui-input-inline">
                            <input name="name" value="" placeholder="请输入姓名" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item layui-inline">
                        <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
                        <button type="reset" class="layui-btn layui-btn-primary" onclick="$.form.reload();">重置</button>
                    </div>
                </form>
                <table id="chageporterTable" data-url="/pcs/order/chageporter" data-target-search="form.form-search"></table>

                <script th:inline="javascript">
                    var id = [[${orderId}]]
                </script>
                <script type="text/javascript" th:inline="none">
                    $(function () {
                        $('#chageporterTable').layTable({
                            even: true,where:{id:id},
                            cols: [[
                                {type: 'radio', title: '选择',fixed: true, width: 90},
                                {title: '序号', type: 'numbers', width: 80},
                                {field: 'name', title: '姓名', minWidth: 180, align: 'center'},
                                {field: 'sex', title: '性别', align: 'center', templet: function (d) {
                                    if (d.sex == 1) {
                                        return '男';
                                    } else if (d.sex == 2) {
                                        return '女';
                                    } else {
                                        return '未知';
                                    }
                                }},
                                {field: 'age', title: '年龄', align: 'center'},
                                {field: 'permission', title: '护理科室权限', align: 'center',templet: function (d) {
                                        var permission = d.porterPermissions;
                                        if (permission.length > 0) {
                                            var str = '';
                                            permission.forEach(function (item, index){
                                                if(item.verifyStatus==1){
                                                    str += '<span class="layui-badge layui-bg-green">'+item.depName+'</span>';
                                                }else{
                                                    str += '<span class="layui-badge layui-bg-gray">'+item.depName+'</span>';
                                                }
                                            })
                                            return str;
                                        } else {
                                            return '无';
                                        }
                                    }},

                            ]]
                        });
                    });

                </script>


            </div>
        </div>

        <div class="text-center layui-form-actions1">
            <button class="layui-btn" data-close  th:attr="data-action=${'/pcs/order/savechageporter?orderId='+orderId}"  data-table-id="chageporterTable" data-rule="ids#{id}" >确认选择</button>
            <button class="layui-btn layui-btn-danger" data-close data-confirm="确定要取消选择吗？" type='button'>取消选择</button>
        </div>


    </div>

</div>